home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / wnos5src.zip / NETUSER.H < prev    next >
Text File  |  1993-08-09  |  2KB  |  56 lines

  1. #ifndef _NETUSER_H
  2. #define _NETUSER_H
  3.  
  4. /* Global structures and constants needed by an Internet user process */
  5.  
  6. #ifndef _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. extern int32 Ip_addr;        /* Our IP address */
  11. extern int Net_error;        /* Error return code */
  12. #define    NONE            0    /* No error */
  13. #define    CON_EXISTS        1    /* Connection already exists */
  14. #define    NO_CONN            2    /* Connection does not exist */
  15. #define    CON_CLOS        3    /* Connection closing */
  16. #define    NO_MEM            4    /* No memory for TCB creation */
  17. #define    WOULDBLK        5    /* Would block */
  18. #define    NOPROTO            6    /* Protocol or mode not supported */
  19. #define    INVALID            7    /* Invalid arguments */
  20.  
  21. #define    INET_EOL        "\r\n"    /* Standard Internet end-of-line sequence */
  22.  
  23. /* Codes for the tcp_open call */
  24. #define    TCP_PASSIVE        0
  25. #define    TCP_ACTIVE        1
  26. #define    TCP_SERVER        2    /* Passive, clone on opening */
  27.  
  28. /* Local IP wildcard address */
  29. #define    INADDR_ANY        0x0L
  30.  
  31. /* Socket structure */
  32. struct socket {
  33.     int32 address;        /* IP address */
  34.     int16 port;            /* port number */
  35. };
  36. #define    NULLSOCK (struct socket *)0
  37.  
  38. /* Connection structure (two sockets) */
  39. struct connection {
  40.     struct socket local;
  41.     struct socket remote;
  42. };
  43.  
  44. /* In domain.c: */
  45. int32 resolve __ARGS((char *name));
  46. int32 resolve_mx __ARGS((char *name));
  47. char *resolve_a __ARGS((int32 ip_address, int shorten));
  48.  
  49. /* In netuser.c: */
  50. int32 aton __ARGS((char *s));
  51. char *tcp_port __ARGS((int16 n));
  52. char *inet_ntoa __ARGS((int32 a));
  53. char *pinet __ARGS((struct socket *s));
  54.  
  55. #endif    /* _NETUSER_H */
  56.